package r21310.chap06.d1116;

import java.util.ArrayList;
import java.util.Iterator;

public class Demo03 {
    public static void main(String[] args) {
        ArrayList <String>arrayList=new ArrayList();
        arrayList.add("刘备");
        arrayList.add("关羽");
        arrayList.add("张飞");
        arrayList.add("赵云");
        //送代器遍历
        Iterator<String>  it=arrayList.iterator();
        while (it.hasNext())//检测指针下一个是否有对象有的话返回true与while循环用正好
        { System.out.println(it.next());}

    }
}
